package com.bytech.common.biz.service.remote.user;

import java.util.List;
import java.util.Set;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytech.common.biz.entity.base.BaseResult;
import com.bytech.common.biz.entity.blogUser.BlogUser;
import com.bytech.common.biz.entity.blogUser.BlogUserAgent;
import com.bytech.common.biz.entity.blogUser.BlogUserLoginDto;
import com.bytech.common.biz.entity.friendChain.FriendChain;
import com.bytech.common.biz.entity.friendChain.FriendChainDto;
import com.bytech.common.biz.entity.friendChain.FriendChainQuery;

/**
 * 远程用户微服务接口
 *
 * @Author Zhao
 * @Create 2021/7/26 11:25
 */
@FeignClient(value = "service-blog-user")
public interface RemoteBlogUserService {

    /*用户相关*/
    @GetMapping("/blogUser/userDetail")
    BaseResult<BlogUser> getUserById(@RequestParam("userId") String userId);

    @GetMapping("/blogUser/getByIds")
    List<BlogUser> getUserByIds(@RequestParam Set<String> userIds);

    @GetMapping("/blogUser/getByToken")
    BaseResult<BlogUser> getUserByToken(@RequestParam("token") String token);

    @PostMapping("/blogUser/login")
    BaseResult<BlogUser> doLogin(@RequestBody BlogUserLoginDto loginDto);

    @PostMapping("/blogUser/register")
    BaseResult<BlogUser> doRegister(@RequestBody BlogUser blogUser);

    @PostMapping("/blogUser/update")
    BaseResult<BlogUser> doUpdate(@RequestBody BlogUser blogUser);

    @PostMapping("/blogUser/updateByAgent")
    BaseResult<BlogUser> doUpdateByAgent(@RequestBody BlogUserAgent userAgent);

    /*友链相关*/
    @PostMapping("/friendChain/pageChainByQuery")
    BaseResult<Page<FriendChainDto>> pageFriendChainByQuery(@RequestBody FriendChainQuery<FriendChain> chainQuery);

    @PostMapping("/friendChain/delete")
    BaseResult<String> deleteChain(@RequestParam String id);

    @PostMapping("/friendChain/modifyChain")
    BaseResult<String> modifyChain(@RequestBody FriendChain friendChain);
}
